Insert Method

Wintellect PowerCollections

Collapse imageExpand ImageCollapseAll imageExpandAll imageDropDown imageDropDownHover imageCopy imageCopyHover image
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Inserts a new item at the given index in the BigList. All items at indexes equal to or greater than index move up one index.

Namespace: Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax

C#
public override sealed void Insert(
	int index,
	T item
)
Visual Basic (Declaration)
Public Overrides NotOverridable Sub Insert ( _
	index As Integer, _
	item As T _
)
Visual C++
public:
virtual void Insert (
	int index, 
	T item
) override sealed

Parameters

index
Int32
The index to insert the item at. After the insertion, the inserted item is located at this index. The first item has index 0.
item
T
The item to insert at the given index.

Remarks

The amount of time to insert an item is O(log N), no matter where in the list the insertion occurs. Inserting an item at the beginning or end of the list is O(N).

Exceptions

ExceptionCondition
System..::ArgumentOutOfRangeExceptionindex is less than zero or greater than Count.

See Also